<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="viewport" content="user-scalable=no, initial-scale=1.0, maximum-scale=1.0, width=device-width">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta content="black" name="apple-mobile-web-app-status-bar-style">
	<meta name="format-detection" content="telephone=no">
	<meta content="telephone=no" name="format-detection">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
	<link rel="stylesheet" media="screen and (max-width:900px)" href="/assets/stylesheets/style_wap.css" type="text/css" />
	<link rel="stylesheet" media="screen and (min-width:900px)" href="/assets/stylesheets/style_pc.css" type="text/css" />
	<title>我的订单</title>
</head>
<body>
	<!-- 前端嵌套写法，仅供前端使用，首页有完整代码 -->
	<div class="topline" id="J_topline" data-test="1">
		<nav th:replace="hjh/include::menuV"></nav>
	</div>
	<div class="porder content">
		<p class="btil" th:if="${metadata.type}==1">未支付订单<span class="btilt">共<span class="btilc" th:text="${metadata.total}">3</span>条数据</span></p>
		<p class="btil" th:if="${metadata.type}==2">我的订单<span class="btilt">共<span class="btilc" th:text="${metadata.total}">3</span>条数据</span></p>
		<p class="btil" th:if="${metadata.type}==3">会员订单<span class="btilt">共<span class="btilc" th:text="${metadata.total}">3</span>条数据</span></p>
		<p class="btil" th:if="${metadata.type}==4">发货订单<span class="btilt">共<span class="btilc"
																				   th:text="${metadata.total}">3</span>条数据</span></p>
		<div class="list clearfix">
			<div class="item" th:each="order:${data}">
				<p class="til" th:text="${'订单编号：'+order.orderNo}">订单编号：7384949789</p>
				<div class="infos clearfix">
					<div class="item_sp wa" th:text="${order.orderTitle}">莓希果缘黑莓原果浆30瓶装</div>
					<div class="item_sp wb"><p class="item_line" th:text="${'￥'+order.salePrice/100+'/单价'}">￥1100.00/单价</p><p class="item_line" th:text="${'数量：x'+order.quantity}">数量：x2</p></div>
					<div class="item_sp wc"><p class="item_line" th:text="${order.receiver + '&ensp;&ensp;' + order.mobile}">张晓峰&ensp;&ensp;18516138788</p><p class="item_line item_line_adr"><span class="item_adr"><span class="item_adri">查看地址</span><span class="item_adrp" th:text="${order.address}">上海市浦东新区郭守敬东新区郭守敬路734号608室</span></span></p></div>
					<div class="item_sp wd"><p class="item_line" th:text="${'合计：￥ '+ #numbers.formatDecimal(order.amount * 0.01, 1, 2) + ' 元'}">合计：￥2200.00</p></div>
					<div class="item_sp we" th:if="${order.orderStatus}==0 and ${order.isExp} == 0"><p class="item_line"><a th:href="@{'/pay?id='+${order.id}}" class="J_btn btn" data-oid="2">立即支付</a></p></div>
					<div class="item_sp we" th:if="${order.orderStatus}==0 and ${order.isExp} == 1"><p class="item_line">已过期</p></div>
					<div class="item_sp we" th:if="${order.orderStatus}==-1"><p class="item_line">已取消</p></div>
					<div class="item_sp we" th:if="${order.orderStatus}==-2"><p class="item_line">已过期</p></div>
					<div class="item_sp we" th:if="${order.orderStatus}==-3"><p class="item_line">无效订单</p></div>
					<div class="item_sp we"
						 th:if="${order.orderStatus == 1 && metadata.type!=4}"><p class="item_line" >已支付,待发货</p></div>
					<div class="item_sp we" th:if="${metadata.type==4}"><a href="javascript:;"
																		   th:onclick="${'deliver(' + order.id + ')'}"
																		   class="btn fbtm"
																		   id="J_btn">发货</a></div>
					<div class="item_sp we" th:if="${order.orderStatus}==2"><p class="item_line" >已发货,待收货</p></div>
					<div class="item_sp we" th:if="${order.orderStatus}==3"><p class="item_line" >已完成</p></div>
				</div>
				<!--
			<div class="item">
				<p class="til">订单编号：7384949789</p>
				<div class="infos clearfix">
					<div class="item_sp wa">莓希果缘黑莓原果浆黑莓原果浆30瓶装</div>
					<div class="item_sp wb"><p class="item_line">￥1100.00/单价</p><p class="item_line">数量：x2</p></div>
					<div class="item_sp wc"><p class="item_line">张晓峰&ensp;&ensp;18516138788</p><p class="item_line item_line_adr"><span class="item_adr"><span class="item_adri">查看地址</span><span class="item_adrp">上海市浦东新区郭守敬东新区郭守敬路734号608室</span></span></p></div>
					<div class="item_sp wd"><p class="item_line">合计：￥2200.00</p></div>
					<div class="item_sp we"><p class="item_line">支付人：Np3847</p></div>
				</div>
			</div>
			<div class="item">
				<p class="til">订单编号：7384949789</p>
				<div class="infos clearfix">
					<div class="item_sp wa">莓希果缘黑莓原果浆30瓶装莓希果缘黑莓原果浆30瓶装</div>
					<div class="item_sp wb"><p class="item_line">￥1100.00/单价</p><p class="item_line">数量：x2</p></div>
					<div class="item_sp wc"><p class="item_line">张晓峰&ensp;&ensp;18516138788</p><p class="item_line item_line_adr"><span class="item_adr"><span class="item_adri">查看地址</span><span class="item_adrp">上海市浦东新区郭守敬东新区郭守敬路734号608室</span></span></p></div>
					<div class="item_sp wd"><p class="item_line">合计：￥2200.00</p></div>
					<div class="item_sp we"><p class="item_line">支付人：Ba748455（代支付）</p></div>
				</div>
			</div>
			<div class="item">
				<p class="til">订单编号：7384949789</p>
				<div class="infos clearfix">
					<div class="item_sp wa">莓希果缘黑莓原果浆30瓶装莓希果缘黑莓原果浆30瓶装</div>
					<div class="item_sp wb"><p class="item_line">￥1100.00/单价</p><p class="item_line">数量：x2</p></div>
					<div class="item_sp wc"><p class="item_line">张晓峰&ensp;&ensp;18516138788</p><p class="item_line item_line_adr"><span class="item_adr"><span class="item_adri">查看地址</span><span class="item_adrp">上海市浦东新区郭守敬东新区郭守敬路734号608室</span></span></p></div>
					<div class="item_sp wd"><p class="item_line">合计：￥2200.00</p></div>
					<div class="item_sp we"><p class="item_line">支付人：Np3847</p></div>
				</div>
			</div>
			-->
		</div>
	</div>
	<nav th:replace="hjh/include::bottomV"></nav>

	<script language="javascript" type="text/javascript" src="/assets/javascript/jquery-2.1.4.min.js"></script>
	<script language="javascript" type="text/javascript" src="/assets/javascript/func.js"></script>
	<script type="text/javascript">
		$(function(){
		});
		function deliver(orderId) {
            $.ajax({
                type: "GET",
                url: "/order/deliver/"+orderId+"?v="+(new Date().getTime()),
                dataType: "json",
                contentType:"application/json",
                success: function(res){
                    if(res.code==0){
                        // 提交成功
                        alert('发货成功');
                        window.location.href = window.location.href;
                    }else{
                        if(res.code==101){
                            errormsg($('#J_amount'),res.msg);
                        }else{
                            errormsg($('#J_payPwd'),res.msg);
                        }
                    };
                },
                complete:function(){
                    isajax = false;
                }
            });
        }
	</script>
</body>
</html>
